<?php
require_once('connection.php');

class User {

    private $name;
    private $login;
    private $passwd;
    private $id;
    private $adress;
    private $date_nais;

    public function setName($name){

        $this->name = $name;
        /*
        $con = Connection.getConnection();
        $con->updateUser($this);
        */
    }

    public function setLogin($login){

        $this->login = $login;
        /*
        $con = Connection.getConnection();
        $con->updateUser($this);
        */
    }

    public function setPasswd($passwd){

        $this->passwd = $passwd;
        /*
        $con = Connection.getConnection();
        $con->updateUser($this);
        */
    }
    public function setAdr($adr){
        $this->adress = $adr;
    }
     public function setDN($dn){
        $this->date_nais = $dn;
    }

    public function getName(){
        return $this->name;
    }

    public function getPasswd(){
        return $this->passwd;
    }

    public function getLogin(){
        return $this->login;
    }

    public function getAdress(){
        return $this->adress;
    }
    public function getDN(){
        return $this->date_nais;
    }

    public function login(){
        $con = Connection::getInstance();
        $con->checkUserLogin($this);
        return $this;
    }

    public function register(){
        $con = Connection::getInstance();
        $con->createUser($this);
    }
    
}